home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / sos3-2.lha / bin / sos-csz < prev    next >
Text File  |  1992-02-13  |  1KB  |  41 lines

  1. #!/bin/sh
  2. # --------------------------------------------------------------------------
  3. # Copyright 1992 by Forschungszentrum Informatik (FZI)
  4. #
  5. # You can use and distribute this software under the terms of the licence
  6. # you should have received along with this program.
  7. # If not or if you want additional information, write to
  8. # Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
  9. # D-7500 Karlsruhe 1, Germany.
  10. # --------------------------------------------------------------------------
  11. # 'sos_csz - 27:02:91 - Dietmar Theobald'
  12. #
  13. # sos-csz [-o] [-l <level>] [<container [<offset]]
  14. #
  15. # Produce size statistics from dump.
  16. #
  17. BINDIR=${SOSPATH-__SOS_INSTALLED_PATH__}/bin/
  18.  
  19. for arg
  20. do
  21.    case "$arg" in
  22.       -l|-o) ;;
  23.          -*) echo >&2 '*** usage: sos-csz [-o] [-l <level>] [<container [<offset]]'
  24.              exit 1 ;;
  25.    esac
  26. done
  27.  
  28. test="${SOSCONTAINER?}"
  29.  
  30. ${BINDIR}dmp $*\
  31.    | sed -e 's|^<\([0-9]*\)/.*:\[\([^(]*\)(\([0-9]*\)).*|\1 \2 \3|'\
  32.    | awk 'BEGIN {FS=" "}
  33.         {a[$1 " of " $2]  += $3
  34.          a[$1 " of  all"] += $3
  35.          b[$1 " of " $2]  += 1
  36.          b[$1 " of  all"] += 1
  37.         }
  38.       END   {for (i in a) print "size/count in " i " = " a[i] " / " b[i]
  39.         }'\
  40.    | sort
  41.